package com.pearl.jacksoncore.demo.databind.anno;

import com.fasterxml.jackson.annotation.*;

import java.util.List;

/**
 * @author TD
 * @version 1.0
 * @date 2024/3/27
 */
@JsonClassDescription("公司")
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "name")
//@JsonIdentityReference(alwaysAsId = true)
public class Company {

    String address;

    @JsonPropertyDescription("公司名称")
    String name;

    //@JsonManagedReference
    List<Dept> deptList;

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Dept> getDeptList() {
        return deptList;
    }

    public void setDeptList(List<Dept> deptList) {
        this.deptList = deptList;
    }

    @Override
    public String toString() {
        return "Company{" +
                "name='" + name + '\'' +
                ", deptList=" + deptList +
                '}';
    }
}
